package main

import(
	"io/ioutil"
	"strings"
	"bytes"
)

func main(){
	data,err:=ioutil.ReadFile("files.txt"); if err!=nil{panic(err)}
	str:=strings.TrimSpace(string(data))
	names:=strings.Split(str, "\n")
	var codeSlice [][]byte
	for _,name:=range(names){
		data,err=ioutil.ReadFile(strings.TrimSpace(name)); if err!=nil{panic(err)}
		codeSlice=append(codeSlice, data)
	}
	code:=bytes.Join(codeSlice, []byte("\n//////////////////////////////////////////////////\n"))
	err=ioutil.WriteFile("shader.glsl", code, 0777); if err!=nil{panic(err)}
}